package com.example.administrator.ksf_zty.BrineActivity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;

import com.example.administrator.ksf_zty.Activity.MainActivity;
import com.example.administrator.ksf_zty.MaterialActivity.MaterialMenuActivity;
import com.example.administrator.ksf_zty.MaterialActivity.MaterialSupplierBackActivity;
import com.example.administrator.ksf_zty.R;
import com.example.administrator.ksf_zty.util.BaseActivity;
import com.example.administrator.ksf_zty.util.TitleUtils;

public class BrineMenuActivity extends BaseActivity {

    ImageButton back;
    Button titleButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_brine_menu);
        SetTitle();
        SetOnClick();
    }

    //给按钮设置事件
    private void SetOnClick() {
        //盐罐扫描
        Button brineMenu_btnYGScan = (Button) findViewById(R.id.BrineMenu_btnYGScan);
        brineMenu_btnYGScan.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(BrineMenuActivity.this, BrineJarYScanActivity.class);
                intent.putExtra("name", "");//传参数
                startActivity(intent);
            }
        });
        //混料罐扫描
        Button brineMenu_btnHLGScan = (Button) findViewById(R.id.BrineMenu_btnHLGScan);
        brineMenu_btnHLGScan.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(BrineMenuActivity.this, BrineJarScanActivity.class);
                intent.putExtra("name", "");//传参数
                startActivity(intent);
            }
        });

        //罐到缸扫描
        Button brineMenu_btnG_G = (Button) findViewById(R.id.BrineMenu_btnG_G);
        brineMenu_btnG_G.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(BrineMenuActivity.this, BrineJar_CylinderActivity.class);
                intent.putExtra("name", "");//传参数
                startActivity(intent);
            }
        });

        //换缸扫描
        Button brineMenu_btnHG_G = (Button) findViewById(R.id.BrineMenu_btnHG_G);
        brineMenu_btnHG_G.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(BrineMenuActivity.this, BrineCylinder_CylinderActivity.class);
                intent.putExtra("name", "");//传参数
                startActivity(intent);
            }
        });
        //缸投线扫描
        Button brineMenu_btnG_X = (Button) findViewById(R.id.BrineMenu_btnG_X);
        brineMenu_btnG_X.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(BrineMenuActivity.this, BrineCylinder_LineActivity.class);
                intent.putExtra("name", "");//传参数
                startActivity(intent);
            }
        });
        //弃罐扫描
        Button brineMenu_btnDeleteMaxG = (Button) findViewById(R.id.BrineMenu_btnDeleteMaxG);
        brineMenu_btnDeleteMaxG.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(BrineMenuActivity.this, BrineDeleteJarActivity.class);
                intent.putExtra("name", "");//传参数
                startActivity(intent);
            }
        });
        //弃缸扫描
        Button brineMenu_btnDeleteG = (Button) findViewById(R.id.BrineMenu_btnDeleteG);
        brineMenu_btnDeleteG.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(BrineMenuActivity.this, BrineDeleteCylinderActivity.class);
                intent.putExtra("name", "");//传参数
                startActivity(intent);
            }
        });
        //返回
        Button brineMenu_btnCancel = (Button) findViewById(R.id.BrineMenu_btnCancel);
        brineMenu_btnCancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(BrineMenuActivity.this, MainActivity.class);
                intent.putExtra("name", "");//传参数
                startActivity(intent);
            }
        });
    }

    //设置Title
    private void SetTitle() {
        back = (ImageButton) findViewById(R.id.back);
        titleButton = (Button) findViewById(R.id.titleButton);
        //设置标题(第三个参数是标题文字，直接替换""内容即可，第五个参数是标题右边按钮文字，第六个参数是设置是否显示返回按钮)
        TitleUtils.setTitle(this, R.id.title_sys_set, "盐水房菜单", this,
                "", true);
        //返回按钮事件
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }
}
